﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;

namespace Relay.UI.Controls.Utility {
    public static class ElementUtility {
        public static bool PointInsideElement(this FrameworkElement obj, Point mousePos) {
            Point internalPos = obj.PointFromScreen(mousePos);

            return internalPos.X > 0 && internalPos.Y > 0 &&
                internalPos.X < obj.ActualWidth && internalPos.Y < obj.ActualHeight;
        }
    }
}
